home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / INPUT / MOVE_DRA.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  6.3 KB  |  130 lines

  1.  
  2. package sub_arctic.input;
  3.  
  4. import sub_arctic.lib.interactor;
  5.  
  6. /** 
  7.  * Input protocol for objects wishing to receive drag input suitable for 
  8.  * moving the object.
  9.  *
  10.  * @see sub_arctic.input.move_drag_focus_agent
  11.  * @author Scott Hudson
  12.  */
  13. public interface move_draggable extends focusable, interactor {
  14.  
  15.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  16.  
  17.   /** Dispatch the start of a drag to the object.  Returns true if the drag
  18.    *  is accepted (and hence the event consumed).  The x,y values give the
  19.    *  position of the start of drag in the parent's coordinate system as 
  20.    *  filtered by the move_drag_filter object established with the move_drag 
  21.    *  agent  (if any).  The event retains the original raw coordinate values.
  22.    *  grab_x, grab_y indicate the offset of the drag start point from the 
  23.    *  origin of the object (this indicates the "grab point" within the object).
  24.    *  The user_info object passed here will be the one that was given to the
  25.    *  agent when focus was established.
  26.    *
  27.    * @param event  evt       The event which "caused" the drag.
  28.    * @param int    x         x position where object should be placed at start 
  29.    *                         of drag (in parent's coordinates).
  30.    * @param int    y         y position where object should be placed at start 
  31.    *                         of drag (in parent's coordinates).
  32.    * @param int    grab_x    x position where drag started (in local coords).
  33.    * @param int    grab_y    y position where drag started (in local coords).
  34.    * @param Object user_info uninterpreted information provided when the object 
  35.    *                         was made the move-drag focus.
  36.    * @return boolean indicating whether the input was consumed.
  37.    */
  38.   public boolean drag_start(
  39.     event evt, 
  40.     int x, int y, 
  41.     int grab_x, int grab_y, 
  42.     Object user_info);
  43.  
  44.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  45.  
  46.   /** Dispatch a movement during a drag.  Returns true if the event should 
  47.    *  be considered to have been consumed.  The x,y values give the
  48.    *  current position of the of drag in the parent's coordinate system as 
  49.    *  filtered by the move_drag_filter object established with the move_drag 
  50.    *  agent (if any).  start_x, start_y give the start position of the drag 
  51.    *  (again, filtered by the established move_drag_filter object, if any). 
  52.    *  The event retains the original raw coordinate values. grab_x, grab_y 
  53.    *  indicate the offset of the drag start point from the origin of the 
  54.    *  object at the start of dragging (this indicates the "grab point" within 
  55.    *  the object).  The user_info object passed here will be the one that was 
  56.    *  given to the agent when focus was established.
  57.    *
  58.    * @param event  evt       The event which "caused" the drag.
  59.    * @param int    x         x position where object should be placed at start 
  60.    *                         of drag (in parent's coordinates).
  61.    * @param int    y         y position where object should be placed at start 
  62.    *                         of drag (in parent's coordinates).
  63.    * @param int    start_x   x position where drag started (in parent's coords).
  64.    * @param int    start_y   y position where drag started (in parent's coords).
  65.    * @param int    grab_x    x position where drag started (in local coords).
  66.    * @param int    grab_y    y position where drag started (in local coords).
  67.    * @param Object user_info uninterpreted information provided when the object 
  68.    *                         was made the move-drag focus.
  69.    * @return boolean indicating whether the input was consumed.
  70.    */
  71.   public boolean drag_feedback(
  72.     event evt,     
  73.     int x, int y, 
  74.     int start_x, int start_y, 
  75.     int grab_x, int grab_y, 
  76.     Object user_info);
  77.  
  78.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  79.  
  80.   /** Dispatch input corresponding to the end of a drag.  Returns true if the
  81.    *  even should be considered to have been consumed.  The x,y values give the
  82.    *  current position of the of drag in the parent's coordinate system as 
  83.    *  filtered by the move_drag_filter object established with the move_drag 
  84.    *  agent (if any).  start_x, start_y give the start position of the drag 
  85.    *  (again, filtered by the established move_drag_filter object, if any). 
  86.    *  The event retains the original raw coordinate values. start_off_x, 
  87.    *  start_off_y indicate the offset of the drag start point from the origin 
  88.    *  of the object at the start of dragging (this indicates the "grab point" 
  89.    *  within the object).  The user_info object passed here will be the one 
  90.    *  that was given to the agent when focus was established.
  91.    *
  92.    * @param event  evt       The event which "caused" the drag.
  93.    * @param int    x         x position where object should be placed at start 
  94.    *                         of drag (in parent's coordinates).
  95.    * @param int    y         y position where object should be placed at start 
  96.    *                         of drag (in parent's coordinates).
  97.    * @param int    start_x   x position where drag started (in parent's coords).
  98.    * @param int    start_y   y position where drag started (in parent's coords).
  99.    * @param int    grab_x    x position where drag started (in local coords).
  100.    * @param int    grab_y    y position where drag started (in local coords).
  101.    * @param Object user_info uninterpreted information provided when the object 
  102.    *                         was made the move-drag focus.
  103.    * @return boolean indicating whether the input was consumed.
  104.    */
  105.   public boolean drag_end(
  106.     event evt,     
  107.     int x, int y, 
  108.     int start_x, int start_y, 
  109.     int grab_x, int grab_y, 
  110.     Object user_info);
  111.  
  112.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  113. }
  114. /*=========================== COPYRIGHT NOTICE ===========================
  115.  
  116. This file is part of the subArctic user interface toolkit.
  117.  
  118. Copyright (c) 1996 Scott Hudson and Ian Smith
  119. All rights reserved.
  120.  
  121. The subArctic system is freely available for most uses under the terms
  122. and conditions described in 
  123.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  124. and appearing in full in the lib/interactor.java source file.
  125.  
  126. The current release and additional information about this software can be 
  127. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  128.  
  129. ========================================================================*/
  130.